package com.frank.controller;

import com.frank.dto.JsonResult;
import com.frank.feign.RecruitFeign;
import com.frank.model.Job;
import com.frank.model.JobRecord;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/deliver")
public class RecruitController {

    @Resource
    private RecruitFeign recruitFeign;

    @RequestMapping(value = "/getJobList", method = RequestMethod.GET)
    public JsonResult<?> getJobList(@RequestParam("recruit_type") String recruit_type) {
        List<Job> jobList = recruitFeign.getJobRecruitListByType(recruit_type).getData();
        return new JsonResult<>(200,"获得工作列表成功",jobList);
    }

    @RequestMapping(value = "/deliverJobWish", method = RequestMethod.POST)
    JsonResult<?> deliverJobWish(@RequestBody JobRecord jobRecord){
        recruitFeign.submitJobWish(jobRecord);
        return new JsonResult<>(200,"提交职业申请成功");
    }

}
